package it.polimi.traveldream.ejbclient.dtos;

import it.polimi.traveldream.utils.enums.BaseProductType;

import java.math.BigDecimal;
import java.util.Date;

import javax.validation.constraints.DecimalMin;

public class ExcursionDTO extends BaseProductDTO {
	private static final long serialVersionUID = -2978187541771478472L;
	private final BaseProductType type = BaseProductType.EXCURSION;
	private String startAddress;
	private String organizer;
	private float pathKm;

	public ExcursionDTO() {
		super();
	}

	public ExcursionDTO(int id, String description, Date endTrip, int maxAvailability,
			boolean overpast, BigDecimal price,int reservations, Date startTrip,
			String startAddress,String organizer, float pathKm) {
		super(id, description, endTrip, maxAvailability, overpast, price, reservations, startTrip);
		this.startAddress = startAddress;
		this.organizer = organizer;
		this.pathKm = pathKm;
	}


	public String getStartAddress() {
		return startAddress;
	}

	public void setStartAddress(String startAddress) {
		this.startAddress = startAddress;
	}

	public String getOrganizer() {
		return organizer;
	}

	public void setOrganizer(String organizer) {
		this.organizer = organizer;
	}

	@DecimalMin("0")
	public float getPathKm() {
		return pathKm;
	}
	
	public void setPathKm(float pathKm) {
		this.pathKm = pathKm;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		ExcursionDTO other = (ExcursionDTO) obj;
		if (type != other.type)
			return false;
		return true;
	}

}
